package com.GDOU.service.serviceImp;

import com.GDOU.bean.Manager;
import com.GDOU.bean.Student;
import com.GDOU.bean.Teacher;
import com.GDOU.mapper.ManagerMapper;
import com.GDOU.mapper.StudentMapper;
import com.GDOU.mapper.TeacherMapper;
import com.GDOU.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class LoginServiceImpl implements LoginService {
    @Autowired
    private ManagerMapper managerMapper;

    @Autowired
    private StudentMapper studentMapper;

    @Autowired
    private TeacherMapper teacherMapper;

    @Override
    public Manager managerLogin(String username, String password) {
        return managerMapper.checkByUsernameAndPassword(username, password);
    }

    @Override
    public Student studentLogin(String username, String password) {
        return studentMapper.checkByUsernameAndPassword(username, password);
    }

    @Override
    public Teacher teacherLogin(String username, String password) {
        return teacherMapper.checkByUsernameAndPassword(username, password);
    }
}
